﻿/**********************************************************************
 * @file   FITKSEAJunctionLine.h
 * @brief  SEA线连接
 * @author BaGuijun (baguijun@163.com)
 * @date   2024-11-11
 *********************************************************************/
#ifndef _FITKSEAJunctionLine_H
#define _FITKSEAJunctionLine_H

#include "FITKAcousticsModelAPI.h"
#include "FITKSEAAbstractJunction.h"

namespace Acoustics
{
    /**
     * @brief  线连接结构体
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-11
     */
    struct  FITKSEAJunLineConStr
    {
        //连接对象id
        int _subSysID = -1;
        //是否启用修改角度
        bool _isAlphaOve = false;
        //角度值
        double _alpha = 0.0;
    };
    /**
     * @brief  SEA线连接
     * @author BaGuijun (baguijun@163.com)
     * @date   2024-11-11
     */
    class FITKAcousticsModelAPI FITKSEAJunctionLine :public FITKSEAAbstractJunction
    {
        FITKCLASS(Acoustics, FITKSEAJunctionLine);
        Q_OBJECT;
    public:
        /**
         * @brief    构造函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        FITKSEAJunctionLine();
        /**
         * @brief    析构函数
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        virtual ~FITKSEAJunctionLine();
        /**
         * @brief    获取耦合对象类型
         * @return   JunctionType       对象类型
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        virtual FITKAbstractJunction::JunctionType getJunctiontType()override;
        /**
         * @brief    添加连接信息
         * @param[i] connection    连接信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        void appendConnection(FITKSEAJunLineConStr& connection);
        /**
         * @brief    替换所有连接信息
         * @param[i] connections   连接信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        void replaceConnections(QList<FITKSEAJunLineConStr>& connections);
        /**
         * @brief    获取所有连接信息
         * @return   QList<FITKSEAJunPointStr>    所有连接信息
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        QList<FITKSEAJunLineConStr> getConnections();
        /**
         * @brief    添加点ID
         * @param[i] pointID       点id 
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        void appendPoint(int pointID);
        /**
         * @brief    获取所有的点ID
         * @return   QList<int>   所有点id
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        QList<int> getPoints();
        /**
         * @brief    替换所有点id
         * @param[i] nodes      所有点
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-14
         */
        void replectPoints(QList<int>& nodes);
        /**
         * @brief    设置线的长度
         * @param[i] length    长度
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-14
         */
        void setLineLength(double length);
        /**
         * @brief    获取线的长度
         * @return   double      线的长度
         * @author   BaGuijun (baguijun@163.com)
         * @date     2024-11-11
         */
        double getLineLength();

    protected:
        /**
         * @brief    更新连接
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2025-01-21
         */
        virtual void updateConnect() override;
        
    protected:
        /**
         * @brief  连接信息
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-11
         */
        QList<FITKSEAJunLineConStr> _connections = {};
        /**
         * @brief  
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-11
         */
        QList<int> _pointsID = {};
        /**
         * @brief  线的长度
         * @author BaGuijun (baguijun@163.com)
         * @date   2024-11-14
         */
        double _length = 0.0;
    };
}

#endif
